import React from 'react';
import { Button, Form, Input, Select } from 'antd';

type PropsType = {
    livesearch:Function
}

const LiveSearch: React.FC<PropsType> = ({livesearch}) => {
    const [form] = Form.useForm();
    // let []
    const onFinish = (values: any) => {
        livesearch(values)
    };

    const onFinishFailed = (errorInfo: any) => {
        console.log('Failed:', errorInfo);
    };

    

    const handelSelect = (value: string) => {

    };

    return (
        <Form
            form={form}
            name="basic"
            labelCol={{ span: 8 }}
            wrapperCol={{ span: 16 }}
            style={{ maxWidth: 600 }}
            initialValues={{ remember: true }}
            onFinish={onFinish}
            onFinishFailed={onFinishFailed}
            autoComplete="off"
            layout="inline"
        >
            <Form.Item label="经纪人" name="broker"
                
            >
                <Input />
            </Form.Item>
            <Form.Item label="直播状态" name="status">
                <Select
                    style={{ width: 120 }}
                    onChange={handelSelect}
                    allowClear
                    options={[
                        {
                            label:"直播中",
                            value:"1",
                            key:"1"
                        },{
                            label:"已结束",
                            value:"0",
                            key:"2"
                        }
                    ]}
                >
                </Select>
            </Form.Item>
            <Form.Item wrapperCol={{ offset: 8, span: 16 }}>
                <Button type="primary" htmlType="submit">
                    搜索
                </Button>
            </Form.Item>
        </Form>
    )
};

export default LiveSearch;